package com.feng.boot.rest;

import com.feng.boot.rest.config.WebMvcConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.web.servlet.View;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.view.ContentNegotiatingViewResolver;

import java.util.Locale;

@Import(WebMvcConfig.class)
@EnableEurekaClient
@SpringBootApplication
public class BootRestfulcrudApplication {

    public static void main(String[] args) {
        SpringApplication.run(BootRestfulcrudApplication.class, args);
    }

    @Bean
    public ViewResolver viewResolver(){
        return new MyViewResolver();
    }

    public static class MyViewResolver implements ViewResolver{

        @Override
        public View resolveViewName(String viewName, Locale locale) throws Exception {
            return null;
        }
    }
}
